<template>
	<picker @change="PickerChange" :value="index" :range="localdata.map(item => item.text)">
		<view class="picker">
			{{index>-1?localdata[index].text:'请选择'}}
		</view>
	</picker>
</template>

<script>
	export default{
		props: {
			title: {type: String},
			localdata: {type: Array}
		},
		data() {
			return {
				index: -1
			}
		},
		methods:{
			PickerChange(e) {
				this.index = e.detail.value
				this.$emit("input", this.localdata[this.index].value)
			}
		}
	}
</script>

<style>
</style>
